/*
 * @Author: xuchao 
 * @Date: 2018-05-21 10:44:29 
 * @Last Modified by: xuchao
 * @Last Modified time: 2018-06-12 16:30:16
 */
import React from 'react';
import { withRouter } from 'react-router-dom';
import Routes from '@/routes';
import { Layout } from 'antd';
import Header from '@/components/Header';
import Footer from '@/components/Footer';
import ManagementNav from '@/views/Management/Nav';

const App = (props) => {
    const { pathname } = props.location;
    return (
        <Layout>
            {
                pathname.indexOf('/management') <= -1 ?
                    <div className="router-views">
                        <Header />
                        <Routes />
                        <Footer />
                    </div>
                    :
                    <div className="router-views">
                        <Header />
                        <Layout>
                            <ManagementNav />
                            <Routes />
                        </Layout>
                    </div>
            }
        </Layout>
    )
}

export default withRouter(App);